/*
 * 
 * 
 * @author: Oren Zamir
 */
package org.valire.usermanagement.services;

import java.util.List;
import java.util.Set;

import org.valire.usermanagement.beans.MethodAccessControl;
import org.valire.usermanagement.beans.Role;


/**
 * The Interface AccessControlMethodService.
 */
public interface MethodAccessControlService {
	
	/**
	 * Creates the acm.
	 *
	 * @param mac the mac
	 * @return the role
	 */
	public MethodAccessControl createMAC(MethodAccessControl mac);
	
	/**
	 * Removes the acm.
	 *
	 * @param mac the mac
	 */
	public void removeMAC(MethodAccessControl mac);
	
	/**
	 * Gets the all roles.
	 *
	 * @return the all roles
	 */
	public List<MethodAccessControl> getAllMethodsAccessControl();	
	
	/**
	 * Gets the method roles.
	 *
	 * @param allRoles the all roles
	 * @return the method roles
	 */
	Set<MethodAccessControl> getMethodsForRoles(Set<Role> allRoles);
	
	/**
	 * Check method access for role.
	 *
	 * @param role the role
	 * @param method the method
	 * @return true, if successful
	 */
	boolean checkMethodAccessForRole(Role role,String method);

	/**
	 * Update mac.
	 *
	 * @param mac the mac
	 */
	void updateMAC(MethodAccessControl mac);
	
}
